# Maintainer: Jan Alexander Steffens (heftig) <heftig@archlinux.org>
# Contributor: Ionut Biru <ibiru@archlinux.org>
# Contributor: William Díaz <wdiaz@archlinux.us>

pkgname=libnice
pkgver=0.1.21
pkgrel=2
pkgdesc="An implementation of the IETF's draft ICE (for p2p UDP data streams)"
url="https://nice.freedesktop.org"
arch=(x86_64)
license=(LGPL)
depends=(
  glib2
  gnutls
  gupnp-igd
)
makedepends=(
  git
  gobject-introspection
  graphviz
  gstreamer
  gtk-doc
  meson
)
optdepends=('gstreamer: "nice" GStreamer plugin')
provides=(libnice.so)
_commit=3d9cae16a5094aadb1651572644cb5786a8b4e2d  # tags/0.1.21^0
source=("git+https://gitlab.freedesktop.org/libnice/libnice.git#commit=$_commit")
b2sums=('SKIP')

pkgver() {
  cd libnice
  git describe --tags | sed 's/[^-]*-g/r&/;s/-/+/g'
}

prepare() {
  cd libnice

  # GUPnP-IGD 1.6
  sed -i 's/gupnp-igd-1\.0/gupnp-igd-1.6/' meson.build
}

build() {
  arch-meson libnice build -D gtk_doc=enabled
  meson compile -C build
}

check() {
  meson test -C build --print-errorlogs
}

package() {
  meson install -C build --destdir "$pkgdir"
}

# vim:set sw=2 sts=-1 et:
